<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function goPage(page){
		document.getElementById("currentPage").value = page;
		document.searchForm.submit();
		
	}
</script>
</head>
<head>
<title>ECSHOP 管理中心 - 商品列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/Styles/general.css" rel="stylesheet" type="text/css" />
<link href="/Styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<s:debug></s:debug>
	<h1>
		<span class="action-span"><a href="/product/input">添加新商品</a></span>
		<span class="action-span1"><a href="">ECSHOP 管理中心</a></span>
		<span id="search_id" class="action-span1"> - 商品列表 </span>
		<div style="clear: both"></div>
	</h1>
	<div class="form-div">
		<s:form name="searchForm"  action="product" namespace="/system">
			<input type="hidden" name="query.currentPage" id="currentPage" value="1">
			<img src="/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />
			商品类型:
			<s:select list="#dirList" name="query.product_dir_id" listKey="id" listValue="name"
			headerKey="-1" headerValue="---请选择---" />
			售价区间(由低到高):<s:textfield name="query.minSalePrice"/>
			~<s:textfield name="query.maxSalePrice"/>
			关键字:<s:textfield name="query.keyWord" />
			<s:submit value="查询" />
			
	</div>
	
	<!-- private Long id; //唯一标识(主键)
	private String name;//商品名称
	private String sn;//商品编号(唯一)
	private BigDecimal costPrice;//商品成本价
	private BigDecimal salePrice;//商品零售价
	private BigDecimal marketPrice;//市场价格
	private String place;//商品生产地
	private String model;//商品规格，
	private Integer num;//库存量
	private String intro; //商品描述信息(长：宽：高 毫米)
	private String bigPic;//商品大图存储路径
	private String smallPic;//商品小图存储路径
	private Integer status;//上架==0/下架==1
	private Integer viewTimes;//游览次数(根据这个确定热门商品)
	private Boolean recommended;//是否推荐
	private java.util.Date inputTime;//上架时间
	private Long dir_id;//商品分类编号(外键) -->
	<!-- 商品列表 -->
		<div class="list-div" id="listDiv">
			<table cellpadding="3" cellspacing="1">
				<tr>
					<th>图片</th>
					<th>编号</th>
					<th>商品名称</th>
					<th>零售价</th>
					<th>产地</th>
					<th>库存</th>
					<th>分类</th>
					<th>状态</th>
					<th>推荐</th>
					<th>游览次数</th>
					<th>操作</th>
				</tr>
				<c:forEach items="${productList.list}" var="list">
					<tr>
					<td align="center"><img alt="无图片" src='<c:out value="${list.smallPic }" default="" />' style="width:80px;height:50px;"></td>
					<td align="center">${list.sn}</td>
					<td align="center">${list.name}</td>
					<td align="center">${list.salePrice}"</td>
					<td align="center">${list.place}</td>
					<td align="center">${list.num}</td>
					<td align="center">${list.dir_id}</td>
					<td align="center">${list.status}</td>
					<td align="center">${list.recommended}</td>
					<td align="center">${list.viewTimes}</td>
					<td align="center">
						<a
						href="" target="_blank"
						title="查看"><img src="/Images/icon_view.gif" width="16"
							height="16" border="0" /></a> <a
						href="/product/input/${list.id}"
						title="编辑"><img src="/Images/icon_edit.gif" width="16"
							height="16" border="0" /></a> <a
						href="/product/delete/${list.id}"
						onclick="" title="回收站"><img src="/Images/icon_trash.gif"
							width="16" height="16" border="0" /></a>
					</td>
					</tr>
				</c:forEach>
			</table>
			
			<!-- 分页开始 -->
			<table id="page-table" cellspacing="0">
				<tr>
					<td width="80%">&nbsp;</td>
					<td align="center" nowrap="ture">
							<a href="/product/list/1">首页</a>
							<c:if test="${productList.pageNumber > 1 }">
								<a href="/product/list/${productList.pageNumber-1}">上一页</a>
							</c:if>
							<c:if test="${productList.pageNumber == 1 }">
								上一页
							</c:if>
							<c:if test="${productList.pageNumber >= 1 && productList.pageNumber != productList.totalPage }">
								<a href="/product/list/${productList.pageNumber+1}">下一页</a>
							</c:if>
							<c:if test="${productList.pageNumber == productList.totalPage}">
								下一页
							</c:if>
							<a href="/product/list/${productList.totalPage}">尾页</a>
						共${productList.totalRow}条数据&nbsp;每页${productList.pageSize}条数据，当前第
						${productList.pageNumber }页/共${productList.totalPage}页
					</td>
				</tr>
			</table>
			<!-- 分页结束 -->
		</div>
	</s:form>
</body>
</html>